package Value类型

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object sample {

    def main(args: Array[String]): Unit = {

        val config: SparkConf = new SparkConf().setMaster("local[*]").setAppName("WordCount")

        val sc = new SparkContext(config)

        val rdd = sc.parallelize(1 to 100)

        val sampleRDD: RDD[Int] = rdd.sample(false, 0.05, System.currentTimeMillis())

        sampleRDD.collect().foreach(println)

        println(sampleRDD.count())


    }

}
